home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / gnuplot / term / debug.trm < prev    next >
Text File  |  1993-09-15  |  3KB  |  155 lines

  1. /*
  2.  * $Id: debug.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  3.  *
  4.  */
  5.  
  6. /* GNUPLOT - debug.trm */
  7. /*
  8.  * Copyright (C) 1990   
  9.  *
  10.  * Permission to use, copy, and distribute this software and its
  11.  * documentation for any purpose with or without fee is hereby granted, 
  12.  * provided that the above copyright notice appear in all copies and 
  13.  * that both that copyright notice and this permission notice appear 
  14.  * in supporting documentation.
  15.  *
  16.  * Permission to modify the software is granted, but not the right to
  17.  * distribute the modified code.  Modifications are to be distributed 
  18.  * as patches to released version.
  19.  *  
  20.  * This software  is provided "as is" without express or implied warranty.
  21.  * 
  22.  * This file is included by ../term.c.
  23.  *
  24.  * This terminal driver supports:
  25.  *  DEBUG
  26.  *
  27.  * AUTHORS
  28.  *    luecken@udel.edu
  29.  * 
  30.  * send your comments or suggestions to (luecken@udel.edu).
  31.  * 
  32.  */
  33.  
  34.  
  35. #define DEBUG_XMAX 512 
  36. #define DEBUG_YMAX 390
  37.  
  38. #define DEBUG_XLAST (DEBUG_XMAX - 1)
  39. #define DEBUG_YLAST (DEBUG_XMAX - 1)
  40.  
  41. /* Assume a character size of 1, or a 7 x 10 grid. */
  42. #define DEBUG_VCHAR    10
  43. #define DEBUG_HCHAR    7
  44. #define DEBUG_VTIC    (DEBUG_YMAX/70)        
  45. #define DEBUG_HTIC    (DEBUG_XMAX/75)        
  46. int DEBUG_linetype_last;
  47. int DEBUG_xlast;
  48. int DEBUG_ylast;
  49.  
  50. DEBUG_init()
  51. {
  52.     fprintf(outfile,"init\n");
  53.     DEBUG_linetype_last = -3;
  54. }
  55.  
  56.  
  57. DEBUG_graphics()
  58. {
  59.     DEBUG_xlast = DEBUG_ylast=0;
  60.     fprintf(outfile,"graphics\n");
  61. }
  62.  
  63.  
  64. DEBUG_text()
  65. {
  66.     fprintf(outfile,"text\n");
  67. }
  68.  
  69.  
  70. DEBUG_linetype(linetype)
  71. int linetype;
  72. {
  73.     /*
  74.     if (linetype != DEBUG_linetype_last){
  75.         fprintf(outfile,"l%d",linetype);
  76.         DEBUG_linetype_last = linetype;
  77.     }
  78.     */
  79.     fprintf(outfile,"line %d\n",linetype);
  80. }
  81.  
  82.  
  83. DEBUG_move(x,y)
  84. int x,y;
  85. {
  86.     /*
  87.     if (x != DEBUG_xlast || y != DEBUG_ylast){
  88.         fprintf(outfile,"mm");
  89.         DEBUG_xlast = x;
  90.         DEBUG_ylast = y;
  91.     }
  92.     */
  93.     fprintf(outfile,"move %d, %d\t(%d, %d)\n",x,y,x-DEBUG_xlast,y-DEBUG_ylast);
  94.     DEBUG_xlast = x;
  95.     DEBUG_ylast = y;
  96. }
  97.  
  98.  
  99. DEBUG_vector(x,y)
  100. int x,y;
  101. {
  102.     /*
  103.     if (x != DEBUG_xlast || y != DEBUG_ylast){
  104.         fprintf(outfile,"vv");
  105.         DEBUG_xlast = x;
  106.         DEBUG_ylast = y;
  107.     }
  108.     */
  109.     fprintf(outfile,"vect %d, %d\t(%d, %d)\n",x,y,x-DEBUG_xlast,y-DEBUG_ylast);
  110.     DEBUG_xlast = x;
  111.     DEBUG_ylast = y;
  112. }
  113.  
  114.  
  115. DEBUG_put_text(x,y,str)
  116. int x, y;
  117. char *str;
  118. {
  119.     /*
  120.     DEBUG_move(x,y);
  121.     fprintf(outfile,"tx%s\r",str);
  122.     */
  123.     fprintf(outfile,"put_text calls:");
  124.     DEBUG_move(x,y);
  125.     fprintf(outfile,"put_text '%s'\n",str);
  126. }
  127.  
  128.  
  129.  
  130. DEBUG_reset()
  131. {
  132.     fprintf(outfile,"reset");
  133. }
  134.  
  135. DEBUG_justify_text(mode)
  136. int mode;
  137. {
  138.     fprintf(outfile,"justify ");
  139.     switch(mode){
  140.         case (CENTRE):
  141.             fprintf(outfile,"centre");
  142.             break;
  143.         case (RIGHT):
  144.             fprintf(outfile,"right");
  145.             break;
  146.         default:
  147.         case (LEFT):
  148.             fprintf(outfile,"left");
  149.             break;
  150.     }
  151.     fprintf(outfile,"\n");
  152.     return(TRUE);
  153. }
  154.  
  155.